#!/bin/bash

ip link set eth0 promisc on

docker network create -d macvlan --subnet 192.168.5.0/24 --gateway 192.168.5.1 -o parent=eth0 macvlan

docker run -d --name openwrt --network macvlan --privileged --restart always buddyfly/openwrt-aarch64:latest

docker exec -it openwrt sed -i '/192.168/d' /etc/config/network
docker exec -it openwrt sed -i '$a option ipaddr "192.168.5.2"' /etc/config/network
docker exec -it openwrt sed -i '$a option gateway "192.168.5.1"' /etc/config/network
docker exec -it openwrt sed -i '$a option dns "192.168.5.1"' /etc/config/network
docker restart openwrt

